import qs from 'qs'
export default class FetchDebug {
  constructor(adapt) {
    this.list = []
    this.adapt = adapt
  }
  save(config) {
    let { url, params } = config
    let p = qs.stringify(params)
    this.list.push({
      url: url + (p ? '?' + p : p),
      config
    })
  }
  again(index) {
    const { config } = this.list[index]
    this.adapt(config).catch((err) => {})
  }
}
